package com.yunhe.sms.dao.activity.impl;

import com.yunhe.commons.dao.impl.BaseDaoImpl;
import com.yunhe.sms.dao.activity.VoteLogDao;
import com.yunhe.sms.entity.activity.VoteLog;

import java.util.List;

/**
 * Created by Administrator on 2017/11/2 0002.
 */
public class VoteLogDaoImpl extends BaseDaoImpl<VoteLog> implements VoteLogDao {

    @Override
    public void save(VoteLog voteLog) {
        String sql = " insert into activity_vote_log(ip,mac,date,vote_id) values(?,?,?,?)";
        super.cud(sql,voteLog.getIp(),voteLog.getMac(),voteLog.getDate(),voteLog.getVoteId());
    }

    @Override
    public List<VoteLog> fingList(Long voteId, String mac, String day) {
        String sql = " select ip,mac,date,vote_id voteId from activity_vote_log where vote_id=? and mac = ? and date_format(date,'%Y-%m-%d')=? ";
        return super.queryList(sql,voteId,mac,day);
    }
}
